//
//  BaseViewController.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/11/21.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "BaseViewController.h"
#import "HomeViewController.h"
#import "AboutusController.h"
#import "RentHouseDetailVC.h"
#import "GoodDetailController.h"
#import "RentHouseHomeVC.h"
@interface BaseViewController ()
/** <#note#> */

@end

@implementation BaseViewController


- (NotOneGoodsView *)logoView{
    
    if (!_logoView) {
        
        NotOneGoodsView *temp = (NotOneGoodsView *)[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([NotOneGoodsView class]) owner:nil options:nil].firstObject;
        
        _logoView = temp;
        
        _logoView.frame = CGRectMake(0, 0, 200, 200);
        
        _logoView.center = CGPointMake(KScreenW * 0.5, KScreenH * 0.5);
        
        _logoView.hidden = YES;
        
        [self.view addSubview:temp];
        
    }
    
    return _logoView;
}




- (UITableView *)plainTableView{
    
    if (_plainTableView == nil) {
        
        UITableView *temp = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH) style:UITableViewStylePlain];
        
        temp.delegate = self;
        temp.dataSource = self;
        
        temp.showsVerticalScrollIndicator = NO;
        temp.showsHorizontalScrollIndicator = NO;
        
        temp.tableFooterView = [[UIView alloc]init];
        
//        temp.estimatedRowHeight = 0;
//        temp.estimatedSectionHeaderHeight = 0;
//        temp.estimatedSectionFooterHeight = 0;
        _plainTableView = temp;
        
        [self.view addSubview:temp];
        
    }
    
    return _plainTableView;
    
    
}


- (UITableView *)groupTableView{
    
    if (_groupTableView == nil) {
        
        UITableView *temp = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH) style:UITableViewStyleGrouped];
        
        temp.delegate = self;
        temp.dataSource = self;
        
        temp.showsVerticalScrollIndicator = NO;
        temp.showsHorizontalScrollIndicator = NO;
        temp.tableFooterView = [[UIView alloc]init];
//        temp.estimatedRowHeight = 0;
//        temp.estimatedSectionHeaderHeight = 0;
//        temp.estimatedSectionFooterHeight = 0;
        _groupTableView = temp;
        
        
        [self.view addSubview:temp];
        
        
    }
    
    return  _groupTableView;
    
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = randomColor;
    
    if (@available(iOS 11.0, *)) {
        
        //        self.groupTableView.contentInsetAdjustmentBehavior = UIApplicationBackgroundFetchIntervalNever;
        
    }
    // Do any additional setup after loading the view.
}


- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    if ([self isKindOfClass:[HomeViewController class]] || [self isKindOfClass:[AboutusController class]] || [self isKindOfClass:[RentHouseDetailVC class]] || [self isKindOfClass:[GoodDetailController class]] || [self isKindOfClass:[RentHouseHomeVC class]]) {
        
    }else{
        
        [self.navigationController setNavigationBarHidden:NO animated:YES];

    }
    
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
    
}



- (UIStatusBarStyle)preferredStatusBarStyle{
    
    return UIStatusBarStyleLightContent;
    
}

#pragma mark - tableviewDelegate

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 0;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 0;
    
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    return [[UITableViewCell alloc]init];
    
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    NSLog(@"------");
    
}


-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
    
//    cell.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1);
//    //x和y的最终值为1
//    [UIView animateWithDuration:0.25 animations:^{
//        cell.layer.transform = CATransform3DMakeScale(1, 1, 1);
//    }];
    
    
}


@end
